#ifndef DURATIONSLIDER_H
#define DURATIONSLIDER_H
#include <QWidget>
#include <QSlider>
#include <QLabel>

class DurationSlider : public QWidget
{
    Q_OBJECT
public:
    explicit DurationSlider(QWidget *parent = nullptr);
    ~DurationSlider() = default;

protected:
    /**
     * @brief 事件分发器
     * @param watched: QObject对象
     * @param event: 事件结构体
     */
    virtual bool eventFilter(QObject * watched, QEvent * event) override;

public:
    /**
     * @brief slider鼠标点击事件
     * @param slider: slider对象
     * @param event: 事件结构体
     */
    void on_slider_mouseLButtonPress(QObject * slider, QEvent * event);

private:
    /**
     * @brief 获取QSS
     */
    QString getQss();

signals:

public slots:
    /**
     * @brief slider数值改变响应槽
     * @param val: slider数值
     */
    void on_slider_valueChanged(int val);
    /**
     * @brief slider鼠标点击释放事件响应槽
     */
    void on_slider_sliderReleased();

private:
    QSlider *slider;    //时长进度条
    QLabel *timeLabel;  //时间显示（当前时间:总时间）(分:秒)
};

#endif // DURATIONSLIDER_H
